var mongoose = require("mongoose");

//文章表(articleOnlineDraft)

var articleOnlineDraftSchema = new mongoose.Schema({
  articleId: {
    type: mongoose.SchemaTypes.ObjectId,
    required: true
  }, //文章id
  articlename: {
    type: String,
    required: true
  }, //文章标题
  articleimg: {
    type: String
  }, //文章主图
  content: {
    type: String,
    required: true
  }, //富文本内容
  userid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "user_login",
    required: true,
  }, //用户id
  deleImgId: {
    type: Array,
    default: []
  }, //需要删除的图片
  deletTitleImageUrl: {
    type: Array,
    default: []
  }, //需要删除的题图图片
  shareArticle: [{
    title: String,
    url: String
  }] //分享文章
});

module.exports = mongoose.model("articleOnlineDraft", articleOnlineDraftSchema);